/*
 自定义表单，逻辑外移
 */
export default {
  //同级组件移动
  levelMove(nowWidget, fromIndex, destIndex) {
    if (fromIndex > destIndex) {
      nowWidget.splice(destIndex, 0, nowWidget[fromIndex]);
      nowWidget.splice(fromIndex + 1, 1);
    } else {
      nowWidget.splice(destIndex, 0, nowWidget[fromIndex]);
      nowWidget.splice(fromIndex, 1);
    }
  },
  subLevelFromIndex(children, widget) {
    let subFormIndex = -1;
    if (children) {
      children.forEach((child, index) => {
        if (child.counterFlag === widget.counterFlag) {
          subFormIndex = index;
        }
      });
    }
    return subFormIndex;
  },
  //1级组件移动到2级
  level1ToLevel2() {},
  //2级组件移动到1级
  level2ToLevel1() {},

  handleMove(nowWidget, fromIndex, destIndex) {},
};
